
%\documentclass[letterpaper,12pt]{article}
%\usepackage[x11names,rgb]{xcolor}
%\usepackage{tikz}
%\usetikzlibrary{snakes}
%\usetikzlibrary{arrows}
%\usetikzlibrary{shapes}
%\usetikzlibrary{backgrounds}
%\usepackage{amsmath}
%\oddsidemargin 0in
%\evensidemargin 0in
%\topmargin 0in
%\headheight 0in
%\headsep 0in
%\textheight 9in
%\textwidth 6.5in
%\begin{document}
%\pagestyle{empty}
%\vspace*{\fill}
%\begin{center}
\documentclass{article}
 
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{tikz}
\usetikzlibrary{snakes}
\usetikzlibrary{arrows}
\makeatletter
 
\begin{document}
\begin{preview}
	%%
	\begin{tikzpicture}[scale=2.4]
	
	\draw[thin, red] (1,2) -- +(0,1);
	\draw[thin, red] (0,1) rectangle +(2,2);
	\draw[thin, red] (0.5,1.5) rectangle +(1,1);
	\draw[thin, red] (0.75,1.75) rectangle +(0.5,0.5);
	\draw[thin, red] (0.875,1.875) rectangle +(0.25,0.25);
	
	\draw[semithick, xstep=2, ystep=2] (0,0) grid (4,4);
	\draw[semithick, xstep=1, ystep=1] (0,0) grid (2,2);
	\draw[semithick, xstep=0.5, ystep=0.5] (1,1) grid (2,2);
	
	\draw[fill=pink] (1,1.5) rectangle +(0.5,0.5);
	\draw[fill=green] (0.9375,1.9375) rectangle +(0.125,0.125);
	\draw[fill=blue] (1,1.9375) rectangle +(0.0625,0.0625);
	
	\draw[fill=green] (4.2,3.5) rectangle +(0.2,0.2);
	\draw[fill=pink] (4.2,2.5) rectangle +(0.2,0.2);
	\draw[fill=blue] (4.2,1.5) rectangle +(0.2,0.2);
	\draw[thin,red] (4.2,0.5) rectangle +(0.2,0.2);
	
	\draw (4.4,3.6) node[right] {\tiny{Search keys}};
	\draw (4.4,2.6) node[right] {\tiny{Current cell}};
	\draw (4.4,1.6) node[right] {\tiny{Search corner}};
	\draw (4.4,0.6) node[right] {\tiny{Search results}};
	
	\end{tikzpicture}%%
\end{preview}
\end{document}

%\end{center}
%\vspace*{\fill}
%\end{document}

    	